<%--
此文件值得说明的地方：
1、使用ext(x)传递参数而不是有意义的名称
2、给tabletag一个id，由于在系统采用了缓存列对象的做法，赋予一个与view相关（可以相同）的id，可以使得各自的列不至于混淆
扩展：
此文件可以作为购物车选购的页面
--%>
<%@page contentType="text/html;charset=UTF-8"%>
<%@ page import="whf.framework.web.Constants"%>
<%@ page import="whf.framework.util.ParamUtils" %>

<%@taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean"%>
<%@taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html"%>
<%@taglib uri="/WEB-INF/tlds/framework.tld" prefix="framework"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"    "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title><framework:attr source="STRUTS-META" attr="name" /></title>
<jsp:include page="/common/inc/select.jsp" />

<script type="text/javascript" src="<%= request.getContextPath() %>/scripts/pic-view/pic-js/prototype.js"></script>
<script type="text/javascript" src="<%= request.getContextPath() %>/scripts/pic-view/pic-js/scriptaculous.js?load=effects"></script>
<script type="text/javascript" src="<%= request.getContextPath() %>/scripts/pic-view/pic-js/lightbox.js"></script>
<link rel="stylesheet" href="<%= request.getContextPath() %>/scripts/pic-view/pic-css/lightbox.css" type="text/css" media="screen" /> 

</head>
<%
long folderId = ParamUtils.getLongParameter(request, "folderId", 0);
if(folderId == 0) folderId = ParamUtils.getLongAttribute(request, "folderId", 0);
String queryString = "t.folder.id="+folderId+" order by t.createDate desc";
//
String viewCode = ParamUtils.getParameter(request, "displayStyle");

int displayColumnCount = 1;
int pageSize = 10;
String displayStyle = "table";
String displayWrapper = null;
if("ViewFileByLargeIcon".equalsIgnoreCase(viewCode)){
	displayColumnCount = 4;
	displayStyle = "block";
	pageSize = 16;
	displayWrapper="whf.file.wrapper.FileDisplayWrapper";
} else if("ViewFileBySmallIcon".equalsIgnoreCase(viewCode)){
	displayColumnCount = 8;
	displayStyle = "block";
	pageSize = 56;
	displayWrapper="whf.file.wrapper.SmallFileDisplayWrapper";
} else {
	viewCode = "";
}
%>
<body>
<html:form action='<%=  (String)request.getAttribute(Constants.STRUTS_PATH) %>' method="post">
<table width='100%'>
	<tr>
		<td width='*'></td>
		<td width='15%' nowrap>
			显示：
			<select name="_$_displayStyle" onchange="displayStyle_change()">
				<option value="">详细信息</option>
				<option value="ViewFileByLargeIcon" <%if("ViewFileByLargeIcon".equalsIgnoreCase(viewCode)){%>selected<%}%>>大图标</option>
				<option value="ViewFileBySmallIcon" <%if("ViewFileBySmallIcon".equalsIgnoreCase(viewCode)){%>selected<%}%>>小图标</option>
			</select>
		</td>
	</tr>
</table>
<html:hidden property="webMethod" value="" />
<framework:ext ignoreParams="displayStyle" />
<framework:table pkStyle="checkbox_counter" id="<%= viewCode %>" navPosition="both" queryString="<%= queryString %>" 
	displayColumnCount="<%= displayColumnCount %>" displayStyle="<%= displayStyle %>" 
	view="<%= viewCode %>" pageSize="<%= pageSize %>" displayWrapper="<%= displayWrapper %>"
>
<framework:caption><span class="whf_object_title"><framework:attr source="STRUTS-META" attr="name" /></span></framework:caption>
</framework:table>
<framework:funcbtn operation="prepareCreate" validationFunction="" valueKey="form.create" />
<framework:funcbtn operation="prepareUpdate" validationFunction="selectionMoreThanOne" valueKey="form.update" />
<framework:funcbtn operation="duplicate" 	validationFunction="selectionMoreThanOne" valueKey="form.duplicate" />
<framework:funcbtn operation="delete" 		validationFunction="selectionMoreThanOne" valueKey="form.delete" />
<html:reset><bean:message key="form.reset" /></html:reset>
</html:form>

</body>
<script>
	function displayStyle_change(){
		submitForm("list");
	}
</script>
</html> 